package com.kabuda.zhugehot200_review;

/**
 * @author kabuda
 * @date 2025-03-29 19:52
 * @description
 */
public class 连续字符 {
    public static void main(String[] args) {
        System.out.println(maxPower("leetcode"));
    }

    public static int maxPower(String s) {
        int length = s.length();
        int max = 1;
        int start = 0;
        for (int i = 1; i < length; i++) {
            if (s.charAt(i) != s.charAt(i - 1)) {
                start = i;
            }
            max = Math.max(max, i - start + 1);
        }

        return max;
    }
}
